import request from '@/config/axios'

export interface MemMessageVO {
  messageId: number
  recordId: number
  sendMemId: number
  reciveMemId: number
  messageType: string
  messageContent: string
  messageStatus: number
  createTime?: string
}

// 查询聊天记录列表
export const getMemMessageByRecordId = async (params) => {
  return await request.get({ url: `/blind/session-record/listByRecordId`, params })
}
// 查询聊天记录列表
export const getMemMessagePage = async (params) => {
  return await request.get({ url: `/blind/member-message/page`, params })
}
// 查询聊天记录列表
export const getMemMessageList = async (params) => {
  return await request.get({ url: `/blind/member-message/list`, params })
}

// 查询聊天记录详情
export const getMemMessage = async (id: number) => {
  return await request.get({ url: `/blind/member-message/get?id=` + id })
}

// 新增聊天记录
export const createMemMessage = async (data: MemMessageVO) => {
  return await request.post({ url: `/blind/member-message/create`, data })
}

// 修改聊天记录
export const updateMemMessage = async (data: MemMessageVO) => {
  return await request.put({ url: `/blind/member-message/update`, data })
}

// 删除聊天记录
export const deleteMemMessage = async (id: number) => {
  return await request.delete({ url: `/blind/member-message/delete?id=` + id })
}

// 导出聊天记录 Excel
export const exportMemMessage = async (params) => {
  return await request.download({ url: `/blind/member-message/export-excel`, params })
}

export const MemMessageCreate = async (params) => {
  return await request.post({ url: `/blind/member-message/create`, params })
}
